#include <2025Linux.h>
int main(int argc, char *argv[])
{
    int fds[2];
    pipe(fds);
    if(fork()){
        close(fds[1]);
        sleep(5);
        printf("sleep over!\n");
        char buf[4096];
        ssize_t ret = read(fds[0],buf,4096);
        printf("ret = %ld\n",ret);
        wait(NULL);
    }
    else{
        close(fds[0]);//子进程也关闭读端
        close(fds[1]);
        while(1){
            sleep(1);
        }
        exit(0);
    }
    return 0;
}

